#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#define pi 3.14159265

float *imdct(float *vet, int N)
{
	int k,n;
	float temp;
	float *comp;

	comp = malloc(N*sizeof(float));

	for(n = 0; n < N; n++)
	{
		comp[n] = 0;
		for(k = 0; k < N/2; k++)
		{
			temp = vet[k]*cos(2*pi/N*(n+(N/2+1)/2)*(k+0.5));
			comp[n] = comp[n] + temp;
		}
		comp[n] = comp[n]*sin(pi*N*(n+0.5))*4/N;
	}
	
	return comp;
}
